{% extends "base.html" %}
{% block title %}Formularios{% endblock %}
{% block mainframe %}

			{% if form %}
				<h1>Formulario: {{ form.name }}</h1>
				<h3>Estad&iacute;sticas</h3>
				
				
				
				{% for section in form.section_set.all %}
					 <ul id="s{{ section.id }}" class="section" href="#s{{ section.id }}">
					   <p class="sectionlabel">{{ section.name }}</p>
					   {% for field in section.formfield_set.all %}
					   		{% if field.type == "RADIO" or field.type == "COMBO" %}
		                       <li id="f{{ field.id }}" class="{{ field.type|lower }}">
									<div class="actions">
										<img src="/beekeeper/images/buttons/more.png" onclick="javascript:expandField('f{{ field.id }}')" class="fieldButton">
									</div>
									<p class="fieldlabel">{{ field.label }}</p>
									
			                       {% if field.fieldoption_set.all %}
										<div class="options">
											<img class="statistic" src="/beekeeper/create_form_field_statistics/{{ form.id }}/{{ field.id }}" class="statisticImage" />
										   {% for option in field.fieldoption_set.all %}
												<p>{{ option.label }}: {{ option.value }}</p>		                       		
										   {% endfor %}
				                       	</div>
			                       {% endif %}
		                       </li>
	                       {% endif %}
					   {% endfor %}
					</ul>
				{% endfor %}
				
				
				
				
				<!--<img src="/beekeeper/images/{{ filename }}" class="fieldButton" />-->
				<br/>
			{% else %}
				<h3>No se ha encontrado el formulario en la base de datos.</h3>
			{% endif %}

{% endblock %}


{% block sidebar %}
		    <ul>
				<li><a class="item" href="/beekeeper/show_form_list/" id="campo0">
					<img src="/beekeeper/images/tw_back.png" />
					<div class="label">
						<p><strong>Volver atr&aacute;s</strong></p>
					</div>
				</a></li>	
			</ul>
{% endblock %}


{% block sectionslinks %}
	<ul>
	{% for section in form.section_set.all %}
		<li id="s{{ section.id }}link">
			<a href="#s{{ section.id }}" onclick="selectSection('s{{ section.id }}')">
				Sección {{ section.order }}
			</a>
		</li>
	{% endfor %}
	</ul>
	
{% endblock %}

